import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";
//查询流程模型列表
export function listProcessModel(query){
	return request({
		url:'/process/model/list',
		method:'get',
		params:query
	})
}


export function getProcessModel(processModelKey){
	return request({
		url:'/process/model/'+ praseStrEmpty(processModelKey),
		// url:'/process/model/',
		method:'get',
		// params:{"processModelKey":processModelKey}
	})
}

// 新增
export function addProcessModel(data) {
  return request({
    url: '/process/model/',
    method: 'post',
    data: data
  })
}
// 保存流程模型
export function saveProcessModel(data) {
  return request({
    url: '/process/model/save',
    method: 'post',
    data: data
  })
}

// 修改
export function updateProcessModel(data) {
  return request({
    url: '/process/model',
    method: 'put',
    data: data
  })
}
//修改状态
export function deployProcessModel(processModelId){
	const data = {
	  processModelId
	}
	return request({
	  url: '/process/model/deployProcess',
	  method: 'put',
	  params: data
	})
}
// 删除
export function delProcessModel(processModelKey) {
  return request({
    url: '/process/model/' + processModelKey,
    method: 'delete'
  })
}
